<nz-drawer [nzClosable]="false" [nzVisible]="visible" nzPlacement="right" nzWidth="500px" nzTitle="定时任务"
           [nzFooter]="footerTpl"
           (nzOnClose)="close()">
  <form nz-form nzLayout="vertical" [formGroup]="validateForm" (ngSubmit)="submitForm()">

    <nz-form-item>
      <nz-form-label nzFor="code"> JOB名称</nz-form-label>
      <nz-form-control nzErrorTip="Please input your roleCode!">
        <input nz-input id="code" formControlName="code"/>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-label nzFor="name"> 所属组</nz-form-label>
      <nz-form-control nzErrorTip="Please input your roleName!">
        <input nz-input id="name" formControlName="name"/>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-label nzFor="deviceGroupId"> CORN表达式</nz-form-label>
      <nz-form-control nzErrorTip="Please input your roleName!">
        <nz-select formControlName="deviceGroupId" id="deviceGroupId">
          <nz-option *ngFor="let item of deviceGroups" [nzLabel]="item.name" [nzValue]="item.id"></nz-option>
        </nz-select>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-label nzFor="type"> 描述信息</nz-form-label>
      <nz-form-control nzErrorTip="Please input your roleName!">
        <input nz-input id="type" formControlName="type"/>

      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-label nzFor="brand"> 触发器</nz-form-label>
      <nz-form-control nzErrorTip="Please input your roleName!">
        <input nz-input id="brand" formControlName="brand"/>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-label nzFor="status"> 状态</nz-form-label>
      <nz-form-control>
        <nz-select nzShowSearch nzAllowClear nzPlaceHolder="Select a status" formControlName="status" id="status">
          <nz-option nzLabel="启用" [nzValue]=1></nz-option>
          <nz-option nzLabel="禁用" [nzValue]=0></nz-option>
        </nz-select>
      </nz-form-control>
    </nz-form-item>

  </form>

  <ng-template #footerTpl>
    <div style="float: right">
      <button nz-button style="margin-right: 8px;" (click)="close()">取消</button>
      <button nz-button nzType="primary" (click)="submitForm()">保存</button>
    </div>
  </ng-template>

</nz-drawer>
